/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.jasoet.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author Deny Prasetyo
 */
@Entity
@Table
public class TransaksiDetail implements java.io.Serializable {

    private static final long serialVersionUID = 993335333334083372L;
    @Id
    @Column(name = "id", length = 5, nullable = false, unique = true)
    private long id;
    @ManyToOne(cascade=CascadeType.ALL)
    @JoinColumn(name="transaksi")
    private Transaksi transaksi;
    @ManyToOne(cascade=CascadeType.ALL)
    @JoinColumn(name="buku")
    private Buku buku;
    @Column(name="harga_jual",length=9,precision=2)
    private double hargaJual;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public Buku getBuku() {
        return buku;
    }

    public void setBuku(Buku buku) {
        this.buku = buku;
    }

    public double getHargaJual() {
        return hargaJual;
    }

    public void setHargaJual(double hargaJual) {
        this.hargaJual = hargaJual;
    }

    public Transaksi getTransaksi() {
        return transaksi;
    }

    public void setTransaksi(Transaksi transaksi) {
        this.transaksi = transaksi;
    }
    
}
